home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / amiga / asrc29k.lha / usock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  1.5 KB  |  70 lines

  1. #ifndef    NULLUSOCK
  2.  
  3. struct loc {
  4.     struct mbuf *q;
  5.     int hiwat;        /* Flow control point */
  6.     int flags;
  7. #define    LOC_SHUTDOWN    1
  8. };
  9. #define    NULLLOC    (struct loc *)0
  10. #define    LOCDFLOW    5    /* dgram socket flow-control point, packets */
  11. #define    LOCSFLOW    2048    /* stream socket flow control point, bytes */
  12. #define    SOBUF        512    /* Size of buffer for usputc()/usprintf() */
  13.  
  14. union cb {
  15.     struct tcb *tcb;
  16.     struct ax25_cb *ax25;
  17.     struct udp_cb *udp;
  18.     struct raw_ip *rip;
  19.     struct raw_nr *rnr;
  20.     struct nr4cb *nr4;
  21.     struct loc *local;
  22.     char *p;
  23. };
  24. union sp {
  25.     struct sockaddr *sa;
  26.     struct sockaddr_in *in;
  27.     struct sockaddr_ax *ax;
  28.     struct sockaddr_nr *nr;
  29.     char *p;
  30. };
  31.  
  32. /* User sockets */
  33. struct usock {
  34.     struct proc *owner;
  35.     int refcnt;
  36.     char noblock;
  37.     char type;
  38. #define    NOTUSED            0
  39. #define    TYPE_TCP        1
  40. #define    TYPE_UDP        2
  41. #define    TYPE_AX25I        3
  42. #define    TYPE_AX25UI        4
  43. #define TYPE_RAW        5
  44. #define TYPE_NETROML3        6
  45. #define TYPE_NETROML4        7
  46. #define    TYPE_LOCAL_STREAM    8
  47. #define    TYPE_LOCAL_DGRAM    9
  48.     int rdysock;
  49.     union cb cb;
  50.     char *name;
  51.     int namelen;
  52.     char *peername;
  53.     int peernamelen;
  54.     char errcodes[4];    /* Protocol-specific error codes */
  55.     struct mbuf *obuf;    /* Output buffer */
  56.     struct mbuf *ibuf;    /* Input buffer */
  57.     char eol[3];        /* Text mode end-of-line sequence, if any */
  58.     int flush;        /* Character to trigger flush, if any */
  59. };
  60. #define    NULLUSOCK    ((struct usock *)0)
  61.  
  62. extern char Badsocket[];
  63. extern char *Socktypes[];
  64. extern struct usock *Usock;
  65. extern int Nusock;
  66.  
  67. struct usock *itop __ARGS((int s));
  68.  
  69. #endif /* NULLUSOCK */
  70.